import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [

   {
    title: '审核人',
    align:"center",
    dataIndex: 'auditPersonId_dictText'
   },
  {
    title: '审核次序',
    align:"center",
    dataIndex: 'sequence'
  },
  {
    title: '审核时间',
    align:"center",
    dataIndex: 'updateTime'
   },
   {
    title: '结果',
    align:"center",
    dataIndex: 'result_dictText'
   },
   {
    title: '意见',
    align:"center",
    dataIndex: 'remark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '申请id',
    field: 'applyId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入申请id!'},
          ];
     },
  },
  {
    label: '审核节点id',
    field: 'auditPointId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入审核节点id!'},
          ];
     },
  },
  {
    label: '结果',
    field: 'result',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入结果!'},
          ];
     },
  },
  {
    label: '意见',
    field: 'reason',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  applyId: {title: '申请id',order: 0,view: 'text', type: 'string',},
  auditPointId: {title: '审核节点id',order: 1,view: 'text', type: 'string',},
  result: {title: '结果',order: 2,view: 'number', type: 'number',},
  reason: {title: '意见',order: 3,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
